﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Data.Linq;
using System.Text;
using Tesla.Service.DataContracts;
using Tesla.DataAccess.DataAccessComponents;
using Tesla.Util.Utilities;
using Tesla.DataAccess.DataAccessLogic.Interfaces;

namespace Tesla.DataAccess.DataAccessLogic.Implementations
{
    public class UserLoginDA : IUserLoginDA
    {
        public void ValidateUser(string userName, string password, ref bool? userExists)
        {
            try
            {
                using (TeslaDataContext context = new TeslaDataContext())
                {
                    context.DeferredLoadingEnabled = false;
                    context.usp_ValidateUser(userName, password, ref userExists);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
    }
}
